// IsisDocSearch.cpp : implementation file
//

#include "stdafx.h"
#include "isismarc.h"
#include "IsisDocSearch.h"
#include "BusquedaView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CIsisDocSearch

IMPLEMENT_DYNCREATE(CIsisDocSearch, CDocument)

CIsisDocSearch::CIsisDocSearch()
{
	Titulo = "";
}

BOOL CIsisDocSearch::OnNewDocument()
{
	//if (!CDocument::OnNewDocument())
	//	return FALSE;
	
	return TRUE;
}

CIsisDocSearch::~CIsisDocSearch()
{
}


BEGIN_MESSAGE_MAP(CIsisDocSearch, CDocument)
	//{{AFX_MSG_MAP(CIsisDocSearch)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIsisDocSearch diagnostics

#ifdef _DEBUG
void CIsisDocSearch::AssertValid() const
{
	CDocument::AssertValid();
}

void CIsisDocSearch::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CIsisDocSearch serialization

void CIsisDocSearch::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CIsisDocSearch commands

void CIsisDocSearch::OnCloseDocument() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	POSITION pos = GetFirstViewPosition();
	CBusquedaView* view = (CBusquedaView*) GetNextView(pos);
	if (view->OnFileClose())
	{
			// 9-8 Cierro ventana de Diccionario
			
			view->CerrarDict();
			
			CDocument::OnCloseDocument();
			CargarMenu(cip_menu+"mn"+cip_lang+"21.mst");
			cerro_ok = true;
			return;
	}
		
	cerro_ok = false;
	
}

BOOL CIsisDocSearch::CanCloseFrame(CFrameWnd* pFrame) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	return CDocument::CanCloseFrame(pFrame);
}



BOOL CIsisDocSearch::OnOpenDocument(LPCTSTR lpszPathName) 
{
	//if (!CDocument::OnOpenDocument(lpszPathName))
	//	return FALSE;
	
	// TODO: Add your specialized creation code here
	
	return TRUE;
}

void CIsisDocSearch::SetearTitulo(CString tit)
{
	Titulo = tit;
	CDocument::SetTitle((LPCSTR)Titulo);
}
